" Multi-encoding setting, MUST BE IN THE BEGINNING OF .vimrc!
"
if has("multi_byte")
	" When 'fileencodings' starts with 'ucs-bom', don't do this manually
	"set bomb
	set fileencodings=utf-8,ucs-bom,chinese,taiwan,japan,korea,latin1
	" CJK environment detection and corresponding setting
	if v:lang =~ "^zh_CN"
		" Simplified Chinese, on Unix euc-cn, on MS-Windows cp936
		set encoding=chinese
		set termencoding=chinese
		if &fileencoding == ''
			set fileencoding=chinese
		endif
	elseif v:lang =~ "^zh_TW"
		" Traditional Chinese, on Unix euc-tw, on MS-Windows cp950
		set encoding=taiwan
		set termencoding=taiwan
		if &fileencoding == ''
			set fileencoding=taiwan
		endif
	elseif v:lang =~ "^ja_JP"
		" Japanese, on Unix euc-jp, on MS-Windows cp932
		set encoding=japan
		set termencoding=japan
		if &fileencoding == ''
			set fileencoding=japan
		endif
	elseif v:lang =~ "^ko"
		" Korean on Unix euc-kr, on MS-Windows cp949
		set encoding=korea
		set termencoding=korea
		if &fileencoding == ''
			set fileencoding=korea
		endif
	endif
	" Detect UTF-8 locale, and override CJK setting if needed
	if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
		set encoding=utf-8
	endif
else
	echoerr 'Sorry, this version of (g)Vim was not compiled with "multi_byte"'
endif
"end for setting multi-encoding setting

set fileencodings=utf-8,ucs-bom,chinese,taiwan,japan,korea,latin1
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
	let opt = '-a --binary '
	if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
	if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
	let arg1 = v:fname_in
	if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
	let arg2 = v:fname_new
	if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
	let arg3 = v:fname_out
	if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
	let eq = ''
	if $VIMRUNTIME =~ ' '
		if &sh =~ '\<cmd'
			let cmd = '""' . $VIMRUNTIME . '\diff"'
			let eq = '"'
		else
			let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
		endif
	else
		let cmd = $VIMRUNTIME . '\diff'
	endif
	silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction

"--------------------------------Great Split Line ------------------
"configures of gjunming@gmail.com
colorscheme darkblue
set nu
set nobackup
syntax on

set autoindent
set smartindent

set tabstop=4
set shiftwidth=4
set expandtab

set showmatch

set guioptions-=T

"set vb t_vb=

set ruler

set nohls

set mouse=a

set cindent

set incsearch

"Make VIM like IDE
" Open and close all the three plugins on the same time 
nmap <F8>   :TrinityToggleAll<CR> 

" Open and close the srcexpl.vim separately 
nmap <F9>   :TrinityToggleSourceExplorer<CR> 

" Open and close the taglist.vim separately 
nmap <F10>  :TrinityToggleTagList<CR> 

" Open and close the NERD_tree.vim separately 
nmap <F11>  :TrinityToggleNERDTree<CR> 

" set tags's path
set tags=tags;
set autochdir

"-----------
"config for windows platform
if has("win32")
    set guifont=Lucida_Console:h11:cANSI
    set guifontwide=Lucida_Console:h12
endif

"config chinese help
if version >=603
	set helplang=cn
endif


	
